<template>
  <span title="全屏" v-if="screen === false">
    <icon-fullscreen @click="setScreen('screen')"
  /></span>
  <span title="退出全屏" v-if="screen === true">
    <icon-fullscreen-exit @click="setScreen('exit')"
  /></span>
</template>

<script lang="ts" setup>
import { reactive, ref } from "vue";

const screen = ref(false);

const setScreen = (val: string) => {
  if (val === "screen") {
    document.documentElement.requestFullscreen();
    screen.value = true;
  } else {
    document.exitFullscreen();
    screen.value = false;
  }
};
</script>
<style scoped lang="less">
svg {
  font-size: 18px;
  cursor: pointer;
  margin: 0 10px;
}
</style>
